// 1. 设置集合结构
const { Schema, model } = require('mongoose');
const studentsSchema = new Schema({
    phone: String,
    password:String,
    name: String,
    gender: String,
    avatar: String // 头像
}, { versionKey: false });
// versionKey: false 去掉数据库的-v
// 2. 设置数据模型，同时连接数据集合，studentsModel可以任意命名
studentsModel = model('studentsModel', studentsSchema, 'students');
//暴露数据
module.exports.studentsModel = studentsModel;